package requests

import (
	"github.com/edgexfoundry/edgex-go/internal/app/dtos"
	"github.com/edgexfoundry/edgex-go/internal/app/dtos/common"
	"github.com/edgexfoundry/edgex-go/internal/app/models"
)

type AddProductFunctionRequest struct {
	common.BaseRequest `json:",inline"`
	ProductFunction    dtos.ProductFunction `json:"productFunction"`
}

type UpdateProductFunctionRequest struct {
	common.BaseRequest `json:",inline"`
	ProductFunction    dtos.ProductFunction `json:"productFunction"`
}

func AddProductFunctionReqToProductFunctionModel(request AddProductFunctionRequest) (ProductFunction models.ProductFunction) {
	ProductFunction = dtos.ToProductFunctionModel(request.ProductFunction)
	return
}

func UpdateFunctionReqToFunctionModel(request UpdateProductFunctionRequest) (ProductFunction models.ProductFunction) {
	ProductFunction = dtos.ToProductFunctionModel(request.ProductFunction)
	return
}
